Page({
  data: {
    userInfo: {
      avatar: '',
      nickName: ''
    },
    showModal: false
  },
  onLoad() {
    this.handleGetOpenUserInfo()
  },
  handleGetOpenUserInfo() {
    my.getOpenUserInfo()
      .then(res => {
        this.setData({
          userInfo: { avatar: res.avatar, nickName: res.nickName }
        })
      })
      .catch(err => {
        console.error('err', err)
      })
  },
  handleJumpLog() {
    my.navigateTo({
      url: '../logs/logs'
    })
  },
  handleShowModal() {
    this.setData({ showModal: true })
  },
  handleCloseModal() {
    this.setData({ showModal: false })
  },
  handlePrimaryButtonTap() {
    this.handleCloseModal()
    my.showToast({ content: '点击主要按钮', duration: 1000 })
  }
})
